import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    collapse: false,
    myData: [],
  },
  getters: {
  },
  mutations: {
    increment(state) {
      state.collapse = !state.collapse;
    },
    updateMyData(state, newData) {
      state.myData = newData;
    }
  },
  actions: {
    handcollapse({ commit }) {
      commit('increment');
    },
    updateMyData({ commit }, newData) {
      commit('updateMyData', newData);
    }
  },
  modules: {
  }
})
